home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / ape-ad1a / midimusi.bas < prev    next >
Encoding:
BASIC Source File  |  1999-09-20  |  1.2 KB  |  52 lines

  1. Attribute VB_Name = "MIDIMusic"
  2. Public myMusic As New CDXVBMusic
  3. Public CurrentFile As String
  4.  
  5. Public Sub PlayIntro()
  6.     Dim temp(1) As String
  7.     Dim lineo As Integer
  8.     
  9.     lineo = 0
  10.  
  11.     Open App.Path & Game.CONFIG_DIR & "music.txt" For Input As #1
  12.         Do Until EOF(1)
  13.             Input #1, temp(lineno)
  14.             lineno = lineo + 1
  15.         Loop
  16.     Close #1
  17.     
  18.     myMusic.Init frmMain.hWnd
  19.     myMusic.Play App.Path & Game.MUSIC_DIR & temp(0)
  20.     CurrentFile = temp(0)
  21. End Sub
  22.  
  23. Public Sub PlayOuttro()
  24.     Dim temp(1) As String
  25.     Dim lineo As Integer
  26.     
  27.     lineo = 0
  28.  
  29.     Open App.Path & Game.CONFIG_DIR & "music.txt" For Input As #1
  30.         Do Until EOF(1)
  31.             Input #1, temp(lineno)
  32.             lineno = lineo + 1
  33.         Loop
  34.     Close #1
  35.     
  36.     myMusic.StopPlaying
  37.     myMusic.Play App.Path & Game.MUSIC_DIR & temp(1)
  38.     CurrentFile = temp(1)
  39. End Sub
  40.  
  41. Public Sub PlayLevelMusic(levelnumber As Integer)
  42.     Dim temp As String
  43.  
  44.     Open App.Path & Game.LEVELS_DIR & "level" & levelnumber & "def.txt" For Input As #1
  45.         Input #1, temp
  46.     Close #1
  47.     
  48.     myMusic.StopPlaying
  49.     myMusic.Play App.Path & Game.MUSIC_DIR & temp
  50.     curentfile = temp
  51. End Sub
  52.